package cloud.kiko.psn.card.service;

import cloud.kiko.psn.card.mapper.CardMapper;
import org.springframework.stereotype.Service;

@Service
public class CardService {
    private final CardMapper cardMapper;

    public CardService(CardMapper cardMapper) {
        this.cardMapper = cardMapper;
    }

    public boolean pay(Long userId,  Double opAmount){
        return cardMapper.update(userId, -opAmount);
    }

    public boolean deposit(Long userId,  Double opAmount){
        return cardMapper.update(userId, opAmount);
    }
}
